//===================================================================================
// Microsoft patterns & practices
// Composite Application Guidance for Windows Presentation Foundation and Silverlight
//===================================================================================
// Copyright (c) Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===================================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===================================================================================
using System;

namespace Microsoft.Practices.Prism.Regions
{
	/// <summary>
	/// Encapsulates information about a navigation request.
	/// </summary>
	public class NavigationContext
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="NavigationContext"/> class for a region name and a 
		/// <see cref="Uri"/>.
		/// </summary>
		/// <param name="navigationService">The navigation service.</param>
		/// <param name="uri">The Uri.</param>
		public NavigationContext(IRegionNavigationService navigationService, Uri uri)
		{
			this.NavigationService = navigationService;

			this.Uri = uri;
			this.Parameters = uri != null ? UriParsingHelper.ParseQuery(uri) : null;
		}

		/// <summary>
		/// Gets the region navigation service.
		/// </summary>
		/// <value>The navigation service.</value>
		public IRegionNavigationService NavigationService { get; private set; }

		/// <summary>
		/// Gets the navigation URI.
		/// </summary>
		/// <value>The navigation URI.</value>
		public Uri Uri { get; private set; }

		/// <summary>
		/// Gets the <see cref="UriQuery"/> extracted from the URI.
		/// </summary>
		/// <value>The URI query.</value>
		public UriQuery Parameters { get; private set; }
	}
}